<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Files Pic list</title>
    <script src="/js/jquery.min.js"></script>
    <style type="text/css">
        .fa{
            margin: 5px;
            padding: 5px;
            cursor:pointer;
            font-size: 18px;
            width: 21px;
            border-radius: 3px;
        }
        .fa:hover {
            background-color: #1d9d74;
            color: #ffffff;
        }
    </style>
</head>
<body>
<div class="mv-list" id="mv-list">

</div>

<script type="text/javascript">
     initPicList();
     var index = parent.layer.getFrameIndex(window.name);
    //给父页面传值
     function getSong(id) {
          //onsole.log("getImg11111:"+number);
          parent.$('#mvId').val(id);
          parent.layer.close(index);
     }

    function initPicList(){
         $("#mv-list").empty();
         $.get("/system/files/page-list",{"pageNum":1,"pageSize":50,"type":3},function(result){
              if (result.code === 200) {
                   let list = result.list;
                   $(list).each(function(){
                        let i = '<i class="fa fa-'+this.id+'" aria-hidden="true"  onclick="getSong(' + this.id + ')" >' + this.fileName + '</i>';
                        $("#mv-list").append(i);
                   });
              } else {
                   alert(result.msg);
              }
         });
    }
</script>
</body>
</html>